<template>
  <div>
    <el-link type="primary" @click="show">
      查看
    </el-link>

    <el-dialog title="销账明细" :visible.sync="centerDialogVisible" width="70%">
      <el-table size="mini" :data="tableData" class="text-sm">
        <el-table-column type="index" label="序号"/>

        <el-table-column
          prop="waybillNo"
          label="运单号"
          sortable
          width="100"
        >
        </el-table-column>

        <el-table-column
          prop="referenceNo"
          label="参考号"
          sortable
          width="100"
        >
        </el-table-column>

        <el-table-column
          prop="masterNumber"
          sortable
          label="M单号"
          width="100"
        >
        </el-table-column>

        <el-table-column
          prop="inStockTime"
          label="入库日期"
          sortable
          width="150"
        >
        </el-table-column>

        <el-table-column
          prop="costName"
          label="费用名称"
          sortable
          width="100"
        >
        </el-table-column>

        <el-table-column
          prop="remain"
          label="余额"
          width="100"
        >
        </el-table-column>

        <el-table-column
          prop="currency"
          label="币种"
          sortable
          width="100"
        >
        </el-table-column>

        <el-table-column
          prop="offMoney"
          label="销账金额"
          width="100"
        >
        </el-table-column>

        <el-table-column
          prop="accountDate"
          label="费用日期"
          sortable
        >
        </el-table-column>

        <el-table-column
          prop="remark"
          label="备注信息">
        </el-table-column>
      </el-table>
    </el-dialog>
  </div>
</template>

<script>
import { ajax } from "@/store/yg/common/utils";

export default {
  props: ["data"],
  data() {
      return {
        centerDialogVisible: false,
        tableData: [],
      };
  },

  methods: {
    async show() {
      let payApplyId = this.data.id;
      this.centerDialogVisible = true;
      let reqObj = {};
      reqObj.arg = payApplyId;
      const { code, data, message } = await ajax(
        "getPayments",
        reqObj
      );
      if (code !== 200) {
        if (message) {
          this.$message.error(message);
        } else {
          this.$message.error("服务器异常");
        }
        return;
      }
      this.tableData = data;
    }
  },

  mounted() {
  }
};
</script>


<style>

</style>
